<header>
    <div class="title">
        <a href="">Cursos</a><span> > </span><strong>Registrar nuevo curso</strong>
    </div>
    <div class="shortcuts">
        <a href=""></a>
    </div>
    <div class="help">
        <a href="">Ayuda</a>
    </div>
</header>
<div class="sidebar">
    <div id="group-create" class="content">
       	<h3>Nuevo Curso</h3>
        <?php if (!empty($validacion)) { ?>
        <div class="alert alert-error">
            <span class="icon block"></span>
            <strong>Se han encontrado errores:</strong>
            <ul>
                <?php foreach ($validacion as $item_fail) { ?>
                    <li><label for="group-create-form-<?php echo $item_fail['item']; ?>"><?php echo $item_fail['message']; ?></label></li>
                <?php } ?>
            </ul>
        </div>
        <?php } ?>
    	<form id="group-create-form" action="#" method="post" enctype="multipart/form-data">
    		<input name="form-action" type="hidden" value="create-group" />
            <div class="form-container">
                <strong class="title">Datos publicos del curso</strong>
                <div class="content">
                    <div class="form-fields">
                        <label>
                            <span class="name">Titulo:</span>
                            <input type="text" id="group-create-form-nombre" name="nombre" value="<?php if ($group->get('grupos','nombre')) echo html_entity_decode($group->get('grupos','nombre')); ?>" placeholder="Ingrese el nombre aqui" autofocus />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Descripcion (publica):</span>
                            <textarea id="group-create-form-descripcion-publica" name="descripcion_publica" placeholder="Esta descripcion es la que se muestra en la oferta"><?php if ($group->get('grupos','descripcion_publica')) echo html_entity_decode($group->get('grupos','descripcion_publica')); ?></textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Cupo minimo:</span>
                            <input type="text" id="group-create-form-cupo" name="cupo" value="<?php if ($group->get('grupos','cupo_min')) echo html_entity_decode($group->get('grupos','cupo_min')); ?>" placeholder="Ingrese la cantidad de alumnos necesarios para empezar el curso aqui" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Precio cuota:</span>
                            <input type="text" id="group-create-form-precio" name="precio" value="<?php if ($group->get('grupos','precio_cuota')) echo html_entity_decode($group->get('grupos','precio_cuota')); ?>" placeholder="Ingrese el precio de la cuota aqui (Escriba la moneda)" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Clases por semana:</span>
                            <select name="clasesxsemana" id="group-create-form-clasesxsemana">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3" selected>3</option>
                            </select>
                            <!--<input type="text" name="clasesxsemana" value="<?php if ($group->get('grupos','clasesxsemana')) echo html_entity_decode($group->get('grupos','clasesxsemana')); ?>" placeholder="Ingrese la cantidad de clases por semana aqui" />-->
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <div class="course-schedule">
                            <!--
                            <label>
                                <span class="name">Horario:</span>
                                <select name="day[]">
                                    <option disabled="" selected="">Día</option>
                                    <option value="1">Lunes</option>
                                    <option value="2">Martes</option>
                                    <option value="3">Miércoles</option>
                                    <option value="4">Jueves</option>
                                    <option value="5">Viernes</option>
                                    <option value="6">Sábado</option>
                                    <option value="0">Domingo</option>
                                </select>
                                &nbsp;-
                                <select name="hour[]">
                                    <option disabled="" selected="">Hora</option>
                                    <option value="0">00</option>
                                    <option value="1">01</option>
                                    <option value="2">02</option>
                                    <option value="3">03</option>
                                    <option value="4">04</option>
                                    <option value="5">05</option>
                                    <option value="6">06</option>
                                    <option value="7">07</option>
                                    <option value="8">08</option>
                                    <option value="9">09</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                    <option value="13">13</option>
                                    <option value="14">14</option>
                                    <option value="15">15</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                    <option value="21">21</option>
                                    <option value="22">22</option>
                                    <option value="23">23</option>
                                </select>
                                &nbsp;:
                                <select name="minutes[]">
                                    <option disabled="" selected="">Minuto</option>
                                    <option value="0">00</option>
                                    <option value="5">05</option>
                                    <option value="10">10</option>
                                    <option value="15">15</option>
                                    <option value="20">20</option>
                                    <option value="25">25</option>
                                    <option value="30">30</option>
                                    <option value="35">35</option>
                                    <option value="40">40</option>
                                    <option value="45">45</option>
                                    <option value="50">50</option>
                                    <option value="55">55</option>
                                    <option value="60">60</option>
                                </select>
                                &nbsp;hs&nbsp;
                                <span class="label label-success"><span class="icon check"></span> Disponible</span>
                            </label>
                            -->
                        </div>
                        <label>
                            <span class="name">Total de clases:</span>
                            <input type="text" id="group-create-form-total" name="total_clases" value="<?php if ($group->get('grupos','total_clases')) echo html_entity_decode($group->get('grupos','total_clases')); ?>" placeholder="Ingrese el total de las clases que lleva el curso" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Promociones/Ofertas:</span>
                            <textarea id="group-create-form-promo" name="promo" placeholder="Ingrese las ofertas o promociones sobre este curso aqui"><?php if ($group->get('grupos','promociones')) echo html_entity_decode($group->get('grupos','promociones')); ?></textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <!--
                        <label>
                            <span class="name">Dia/s:</span>
                            <input type="text" id="group-create-form-dias" name="dias" value="<?php if ($group->get('calendario','dias')) echo html_entity_decode($group->get('calendario','dias')); ?>" placeholder="Ingrese los dias en los que se va dictar el curso aqui" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Horario:</span>
                            <input type="text" id="group-create-form-horarios" name="horarios" value="<?php if ($group->get('calendario','horarios')) echo html_entity_decode($group->get('calendario','horarios')); ?>" placeholder="Ingrese los horarios que se van a dictar el curso aqui"  />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        -->
                        <label>
                            <span class="name">Plan:</span>
                            <select name="plan">
                                <option value='0'>Seleccionar plan (opcional)</option>
                                <?php foreach($arr_plans as $plan) { ?>
                                <option value="<?php echo $plan['id'];?>" <?php if ($plan['id'] == $group->get('grupos','fk_plan')) echo "selected";?>><?php echo $plan['nombre'];?></option>
                                <?php } ?>
                            </select>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-container">
                <strong class="title">Datos privado del curso</strong>
                <div class="content">
                    <div class="form-fields">
                        <label>
                            <span class="name">Nombre:</span>
                            <input type="text" id="group-create-form-nombre" name="nombre" value="<?php if ($group->get('grupos','nombre')) echo html_entity_decode($group->get('grupos','nombre')); ?>" placeholder="Ingrese el nombre aqui"  />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                    	<label>
                            <span class="name">Descripcion:</span>
                            <textarea name='descripcion' placeholder="Ingrese la descripcion privada, que solo los administradores del curso podran ver"><?php if ($group->get('grupos','descripcion')) echo html_entity_decode($group->get('grupos','descripcion')); ?></textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                    </div>
                </div>
            </div>
            <?php if (count($arr_students)>0) { ?>
            <div class="groups-students-selector clearfix" id="students-selector">
                <div class="form-container all-students">
                    <strong class="title">Listado de todos los alumnos</strong>
                    <div class="content">
                        <div class="search">
                            <span class="icon search"></span>
                            <input value="" type="text" placeholder="Buscar..." />
                            <button class="clear"><span class="icon circled-cross"></span><span class="text">Borrar</span></button>
                        </div>
                        <div class="filters hidden">
                            <strong>Filtrar por:</strong>
                            <button class="button" data-filter="2">Regulares</button>
                            <button class="button" data-filter="3">No regulares</button>
                            <button class="button" data-filter="4">Potencial</button>
                        </div>
                        <div class="form-fields">
                            <div class="no-students-msg">
                                <span>No se encuentran alumnos</span>
                            </div>
                            <?php foreach ($arr_students as $student) { ?>
                            <label class="no-quote">
                                <input type="checkbox" value="<?php echo $student['id'];?>" <?php if (@in_array((string)$student['id'],$_POST['students'])) echo 'checked'; ?> />
                                <img src="<?php echo $host; ?>/test/content/test-student-32x32.jpg" class="size-32x32" />
                                <span class="text"><?php echo $student['nombre']. ' ' .$student['apellido']; ?> (<?php echo $student['email']; ?>)</span>
                            </label>
                            <?php } ?>
                        </div>
                    </div>
                </div>
                <div class="form-container selected-students">
                    <strong class="title">Alumnos seleccionados (<span class="total">0</span>)</strong>
                    <div class="content">
                        <div class="form-fields">
                            <div class="no-students-msg">
                                <span><span class="icon warning"></span> No hay alumnos seleccionados</span>
                            </div>
                            <!--<label class="no-quote">
                                <input value="" type="checkbox" name="students[]" checked readonly />
                                <img src="content/test-student-32x32.jpg" class="size-32x32" />
                                <span class="text">Laoreet dolore</span><button class="button important red">Deseleccionar</button>
                            </label>-->
                        </div>
                    </div>
                </div>
            </div>
            <?php } ?>
            <div class="form-buttons">
                <button class="button important blue" type="submit"><span class="icon circled-plus"></span> Registrar Grupo</button>
                <a class="button important red" href="<?php echo $host .'groups/'; ?>">Cancelar</a>
                <a class="button" href="<?php echo $host . 'groups/'; ?>"><span class="icon list"></span> Volver al listado</a>
            </div>
        </form>
    </div>
</div>